package com.nageoffer.jobtrain.admin.remote;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nageoffer.jobtrain.admin.common.config.OpenFeignConfiguration;
import com.nageoffer.jobtrain.admin.remote.req.UserBlockingReqDTO;
import com.nageoffer.jobtrain.admin.remote.req.UserLiftingReqDTO;
import com.nageoffer.jobtrain.admin.remote.resp.UserPageRespDTO;
import com.nageoffer.jobtrain.common.web.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 用户管理远程调用 -基于OpenFeign
 * author：唐晨
 */
@FeignClient(
        value = "JobTrain-project",
        url = "${user-manage.remote-url:}",
        configuration = OpenFeignConfiguration.class
)
public interface UserManageActualRemoteService {
    /**
     * 用户分页查询
     *
     * @param current     当前页
     * @param size        每页数量
     * @param phoneNumber 用户手机号（账户）
     * @param nickName    昵称
     * @return 用户分页查询远程响应
     */
    @PostMapping("/api/job-train/project/user/page")
    Result<Page<UserPageRespDTO>> pageUserList(@RequestParam("current") Long current,
                                               @RequestParam("size") Long size,
                                               @RequestParam("phoneNumber") String phoneNumber,
                                               @RequestParam("nickName") String nickName);

    /**
     * 用户状态拉黑
     *
     * @param requestParam 拉黑用户状态请求实体
     */
    @PostMapping("/api/job-train/project/user/blocking")
    void blockingUserStatus(@RequestBody UserBlockingReqDTO requestParam);

    /**
     * 用户拉黑状态解禁
     *
     * @param requestParam 解禁用户拉黑状态请求实体
     */
    @PostMapping("/api/job-train/project/user/lifting")
    void liftingUserStatus(@RequestBody UserLiftingReqDTO requestParam);
}
